import type {PageParam, PageResult} from '@vben/request';
import type {Dayjs} from 'dayjs';

import {requestClient} from '#/api/request';
export namespace PerFamilyDepositApi {
  /** 国境外存款信息信息 */
  export interface FamilyDeposit {
    id: number; // 主键ID
    employeeId?: number; // 人员ID，对应 per_employee.id
    relation: string; // 与本人关系（称谓）
    systemPersonId: number; // 系统人员ID，对应 system_person.id
    familyName: string; // 存款人姓名
    cardType: string; // 证件类型
    familyIdcard: string; // 存款人身份证号
    countryCity: string; // 存款的国家地区及城市
    bankName: string; // 开户银行或金融机构全称
    currency: string; // 存款币种
    amountRmb: number; // 人民币金额
    remark: string; // 备注
    status: number; // 状态（1：有效，0：无效）
  }
}

/** 查询国境外存款信息分页 */
export function getFamilyDepositPage(data: PageParam,desensitize: boolean,encrypt: boolean) {
  return requestClient.post<PageResult<PerFamilyDepositApi.FamilyDeposit>>('/per/family-deposit/page', data,{ desensitize,encrypt });
}

/** 查询国境外存款信息详情 */
export function getFamilyDeposit(id: number) {
  return requestClient.get<PerFamilyDepositApi.FamilyDeposit>(`/per/family-deposit/get?id=${id}`);
}

/** 新增国境外存款信息 */
export function createFamilyDeposit(data: PerFamilyDepositApi.FamilyDeposit) {
  return requestClient.post('/per/family-deposit/create', data);
}

/** 修改国境外存款信息 */
export function updateFamilyDeposit(data: PerFamilyDepositApi.FamilyDeposit) {
  return requestClient.put('/per/family-deposit/update', data);
}

/** 删除国境外存款信息 */
export function deleteFamilyDeposit(id: number) {
  return requestClient.delete(`/per/family-deposit/delete?id=${id}`);
}

/** 批量删除国境外存款信息 */
export function deleteFamilyDepositList(ids: number[]) {
  return requestClient.delete(`/per/family-deposit/delete-list?ids=${ids.join(',')}`)
}

/** 导出国境外存款信息 */
export function exportFamilyDeposit(params: any) {
  return requestClient.download('/per/family-deposit/export-excel', { params });
}
